Minor redisplay optimisations
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 24 Feb 2017 02:17:04 +0000 (21:17 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 24 Feb 2017 02:17:04 +0000 (21:17 -0500)
* src/frame.c (Ficonify_frame): No need to redisplay everything.

* src/xdisp.c (overlay_arrows_changed_p): Add `set_redisplay' argument.
(redisplay_internal): Use it to avoid redisplaying everything.
(try_window_id): Use it keep the same behavior as before.

src/frame.c
src/xdisp.c

index d0f653fc76249475943c7cc63fcfb08eb8cb91a7..5e1e2f19906837bdfb972749efcbd57b5f72c91d 100644 (file)
@@ -2156,9 +2156,6 @@ If omitted, FRAME defaults to the currently selected frame.  */)
 #endif
     }
 
-  /* Make menu bar update for the Buffers and Frames menus.  */
-  windows_or_buffers_changed = 17;
-
   return Qnil;
 }
 
index e59934d2d5a91cefb067e900aff9999b6ea0bc07..b0ff627c70e8e0b3bc4ec46085c291751e45de2d 100644 (file)
@@ -13336,7 +13336,7 @@ overlay_arrow_in_current_buffer_p (void)
    has changed.  */
 
 static bool
-overlay_arrows_changed_p (void)
+overlay_arrows_changed_p (bool set_redisplay)
 {
   Lisp_Object vlist;
 
@@ -13356,7 +13356,12 @@ overlay_arrows_changed_p (void)
                Fget (var, Qlast_arrow_position))
          || ! (pstr = overlay_arrow_string_or_property (var),
                EQ (pstr, Fget (var, Qlast_arrow_string))))
-       return true;
+       {
+         if (set_redisplay)
+           bset_redisplay (XMARKER (val)->buffer);
+         else
+           return true;
+       }
     }
   return false;
 }
@@ -13781,10 +13786,9 @@ redisplay_internal (void)
 
   /* If specs for an arrow have changed, do thorough redisplay
      to ensure we remove any arrow that should no longer exist.  */
-  if (overlay_arrows_changed_p ())
-    /* Apparently, this is the only case where we update other windows,
-       without updating other mode-lines.  */
-    windows_or_buffers_changed = 49;
+  /* Apparently, this is the only case where we update other windows,
+     without updating other mode-lines.  */
+  overlay_arrows_changed_p (true);
 
   consider_all_windows_p = (update_mode_lines
                            || windows_or_buffers_changed);
@@ -18282,7 +18286,7 @@ try_window_id (struct window *w)
 
   /* Can't use this if overlay arrow position and/or string have
      changed.  */
-  if (overlay_arrows_changed_p ())
+  if (overlay_arrows_changed_p (false))
     GIVE_UP (12);
 
   /* When word-wrap is on, adding a space to the first word of a